1. Field of the Invention
This invention relates to an automatic discriminating and decoding apparatus for automatically discriminating a system of digital data from among a plurality of different systems and decoding the digital data, and more particularly to an automatic discriminating and decoding apparatus which is suitably applied to process bar codes of a plurality of different systems.
2. Description of the Related Art
An equipment in which digital data of a plurality of different systems are processed involves a decoding apparatus which can discriminate and decode digital data of any of the different systems. For example, in an equipment in which bar code information is processed, different bar code systems such as the "JAN", "ITF" and "NW7" systems are used in accordance with a field of application of a bar code, and also a bar code scanner for reading and decoding a bar code can preferably handle bar codes of any of the different systems. A bar code scanner of the type just mentioned is disclosed, for example, in Japanese Patent Laid-Open Application No. 62-10781. An automatic discriminating and decoding apparatus employed in the bar code scanner is shown in FIG. 2.
Referring to FIG. 2, the conventional automatic discriminating and decoding apparatus shown includes a count value memory 1, three decoders 2 to 4, three AND gates 5 to 7 and an OR circuit 8 and has a pair of input terminals 9 and 10.
In operation, when a bar code not shown is read by means of an optical head not shown, a binary signal which presents different levels in accordance with black and white bars of the bar code is obtained, and the binary signal is supplied to a timer counter not shown, by which a count value N representative of a width of each of the bars of the bar code is obtained. The count values N of the successive bars are successively written into the count value memory 1.
After the optical head reads the entire bar code and the count values N of all of the bars of the entire bar code are written into the count value memory 1, a reading start signal SR of the high ("H") level is supplied from the input terminal 9 to the count value memory 1 by way of the OR circuit 8. Consequently, the count value memory 1 reads out the thus written count values N in the order in which they were written. The count values N are supplied to the decoders 2 to 4. Each of the decoders 2 to 4 includes a bit image converter, a bit image memory, a character converter and so forth and processes the count values N from the count value memory 1 to decode the read bar code. Here, it is assumed that the decoder 2 decodes a bar code of the JAN system; the decoder 3 decodes a bar code of the ITF system; and the decoder 4 decodes a bar code of the NW7 system.
Meanwhile, the reading start signal SR is supplied also to the decoder 2 as a starting signal. Consequently, first the decoder 2 starts its decoding operation using a clock signal CK from the input terminal 10. The decoder 2 thus decodes the count values N from the count value memory 1, and when the bar code read is of the JAN system and is successfully decoded, decoded data DD are outputted from the decoder 2. In this instance, the decoder 2 also outputs a decoding end signal E1 to the AND gate 5.
In case the count values N outputted from the count value memory 1 represent a bar code of any bar code system other than the JAN system, the decoder 2 cannot successfully decode the count values N, and when this is detected, the decoder 2 outputs a decoding end signal E1 and simultaneously outputs a decoding failure signal F1 of the "H" level. Consequently, an error signal ER1 of the "H" level is outputted from the AND gate 5. The error signal ER1 is supplied on one hand to the count value memory 1 as a reading start signal by way of the OR circuit 8 and on the other hand to the decoder 3 as a start signal. The count value memory 1 thus starts reading of the count values N thereof from the beginning, and the decoder 3 fetches the count values N and starts its decoding operation.
In case the count values N from the count value memory 1 then represent a bar code of the ITF system, the decoder 3 decodes the count values N. After the count values N are successfully decoded, the decoder 3 outputs decoded data DD and simultaneously outputs a decoding end signal E2 of the "H" level to the AND gate 6. However, when the count values N from the count value memory 1 otherwise represent a bar code of the NW7 system, the decoder 3 cannot successfully decode the count values N and outputs a decoding end signal E2 and a decoding failure signal F2 of the "H" level similarly to the decoder 2. Consequently, an error signal ER2 of the "H" level is outputted from the AND gate 6.
Also the error signal ER2 serves as a reading start signal for the count value memory 1 and a start signal for the next decoder 4 similarly to the error signal ER1. Consequently, reading out of the count value memory 1 is resumed, and the decoder 4 decodes the count values N read out from the count value memory 1. Thus, when a bar code of the NW7 system is read, it is decoded by the decoder 4 so that decoded data DD are obtained.
A bar code of the JAN, ITF or NW7 system is decoded by one of the decoders 2 to 4 in such a manner as described above. While the three decoders 2 to 4 are provided in this manner, when a bar code of some other system than the JAN, ITF and NW7 systems is read, an error signal ER3 is generated from the AND gate 7 in response to a decoding end signal E3 and a decoding failure signal F3 outputted from the last stage decoder 4. Such error signal ER3 can be used to provide a display that the bar code cannot be decoded. If an additional decoder or decoders for bar codes of some other bar code system or systems are connected in a similar connecting relationship to the decoders 2 to 4, then bar codes of an increased number of bar code systems can be decoded by the automatic discriminating and decoding apparatus.
However, the conventional automatic discriminating and decoding apparatus requires a comparatively long interval of time after starting of reading of a bar code till successful decoding of the bar code because a system of the bar code read is discriminated by successive judgments of success or failure in decoding by the decoders 2, 3 and 4.
While information of a name of an article of merchandise, a price or the like is represented by a combination of a plurality of characters such as letters and numerals, a bar code is a representation by an array of bars of a combination of characters representing desired information with each character coded by a combination of a plurality of bars having different widths. While such count values as written into and read out from the count value memory 1 shown in FIG. 2 are numerical data representing widths of the individual bars, when the bar code read is to be decoded from the count values N, it is first judged at any of the decoders 2 to 4 whether each of the count values N represents a thin bar or a thick bar (here, it is assumed that a bar code consists of thin bars and thick bars). The judgment is bit image conversion, and data obtained by such bit image conversion are a bit image which is binary digital data which differ in value between a thin bar and a thick bar. Subsequently, such bit images for one character are combined and are successively compared with combinations of bit images for all characters registered in advance to find out character code data corresponding to the combination of bit images. Such processing is character conversion, and character code data thus obtained are such decoded data DD as described hereinabove.
Such decoding processing as described just above is performed on each of the decoders 2 to 4. Thus, when a bar code of a bar code system other than the JAN system is read, the decoder 2 will generate a decoding end signal E1 and a decoding failure signal F1 since it cannot decode a first character of the bar code. However, those signals E1 and F1 are not generated until after the combination of bit images corresponding to the first character is compared with all of combinations of bit images of characters registered in the decoder 2. Consequently, a long period of time is required for judgment of failure in decoding.
Thus, if it is assumed now that a bar code of the NW7 system is read, it is decoded by the decoder 4 after failure in decoding has been judged successively by the decodes 2 and 3. Accordingly, a long period of time is required after reading of a bar code of the NW7 system till completion of decoding of the bar code. Besides, if it is tried to construct the automatic discriminating and decoding apparatus so that it can read and decode bar codes of a greater number of bar code systems, then as the number of such bar code systems for an object increases, the period of time until decoded data of a bar code are obtained increases as much.